package class02;

/**
 * @author zhangchaoliang
 * create 2022
 */
public class GetMax1 {
    public static int getMax(int[] arr){
        return process(arr,0,arr.length-1);
    }

    private static int process(int[] arr, int L, int R) {
        if (L==R)
            return L;
        int mid = L+((R-L)>>1);
        int leftMax = process(arr,L,mid);
        int rightMax = process(arr,mid+1,R);
        return Math.max(leftMax,rightMax);
    }
}
